//
//  GJFReferenceTableViewCell.m
//  Wedding
//
//  Created by 郭静芬 on 2017/1/9.
//  Copyright © 2017年 郭静芬. All rights reserved.
//

#import "GJFReferenceTableViewCell.h"

@interface GJFReferenceTableViewCell ()
@property (nonatomic, strong) UIImageView *imagePrice;
@property (nonatomic, strong) UILabel *labelPrice;
@property (nonatomic, strong) UIImageView *imageAddress;
@property (nonatomic, strong) UILabel *labelAddress;
@property (nonatomic, strong) UIImageView *imageYear;
@property (nonatomic, strong) UILabel *labelYear;
@end

@implementation GJFReferenceTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self=[super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}

- (void)setReferenceModel:(GJFInspirationModel *)referenceModel {
    _referenceModel = referenceModel;
    self.labelPrice.text = [NSString stringWithFormat:@"参考价格 ￥ %@", [referenceModel.merchant.myCase[0] price]];
    self.labelAddress.text = [referenceModel.merchant.myCase[0] place];
    self.labelYear.text = [referenceModel.merchant.myCase[0] time];
}

-(void)layoutSubviews {
    [super layoutSubviews];
    self.imagePrice.frame = CGRectMake(15, 11, 18, 18);
    self.labelPrice.frame = CGRectMake(45, 8, WIDTH / 2, 25);
    self.imageAddress.frame = CGRectMake(15, 38, 18, 18);
    self.labelAddress.frame = CGRectMake(45, 35, WIDTH / 2, 25);
    self.imageYear.frame = CGRectMake(15, 65, 18, 18);
    self.labelYear.frame = CGRectMake(45, 62, WIDTH / 2, 25);


}


- (UIImageView *)imagePrice {
    if (!_imagePrice) {
        _imagePrice = [[UIImageView alloc] init];
        [_imagePrice setImage:[UIImage imageNamed:@"价格"]];
        [self.contentView addSubview:_imagePrice];
    }
    return _imagePrice;
}
- (UILabel *)labelPrice {
    if (!_labelPrice) {
        _labelPrice = [[UILabel alloc] init];
        _labelPrice.textColor = [UIColor darkGrayColor];
        _labelPrice.font = [UIFont systemFontOfSize:16 * XX];
        [self.contentView addSubview:_labelPrice];
    }
    return _labelPrice;
}
- (UIImageView *)imageAddress {
    if (!_imageAddress) {
        _imageAddress = [[UIImageView alloc] init];
        [_imageAddress setImage:[UIImage imageNamed:@"地址"]];
        [self.contentView addSubview:_imageAddress];
    }
    return _imageAddress;
}
- (UILabel *)labelAddress {
    if (!_labelAddress) {
        _labelAddress = [[UILabel alloc] init];
        _labelAddress.textColor = [UIColor darkGrayColor];
        _labelAddress.font = [UIFont systemFontOfSize:16 * XX];
        [self.contentView addSubview:_labelAddress];
    }
    return _labelAddress;
}
- (UIImageView *)imageYear {
    if (!_imageYear) {
        _imageYear = [[UIImageView alloc] init];
        [_imageYear setImage:[UIImage imageNamed:@"年份"]];
        [self.contentView addSubview:_imageYear];
    }
    return _imageYear;
}
- (UILabel *)labelYear {
    if (!_labelYear) {
        _labelYear = [[UILabel alloc] init];
        _labelYear.textColor = [UIColor darkGrayColor];
        _labelYear.font = [UIFont systemFontOfSize:16 * XX];
        [self.contentView addSubview:_labelYear];
    }
    return _labelYear;
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
